module.exports = function(lab) {
    return {
        @importSKUFromExcel: function(session, request) {
            return lab.snapshot(function(snapshot) {
                return @.async.all(request.file || [], function(skuInfo) {
                    snapshot.slime.brand.@importSKU(session.currentOU.id, {
                        barcode: skuInfo.barcode,
                        item_code: skuInfo.item_code,
                        retail_unit: skuInfo.retail_unit,
                        name: skuInfo.name,
                        brand: skuInfo.brand,
                        category: skuInfo.category,
                        list_price: skuInfo.list_price ? parseInt(skuInfo.list_price) : 0,
                        market_price: skuInfo.market_price ? parseInt(skuInfo.market_price) : 0,
                        image_url: skuInfo.image_url,
                        on_sale: true,
                        tags: skuInfo.tags ? skuInfo.tags.filter(tag => tag) : []
                    }).pipe(this);
                })
            })
        }
    }
}